#include<iostream>
#include<graphics.h>
#include<conio.h>
#include<tchar.h>
#include<windows.h>
#include"snake.h"
using namespace std;
void showImage(const wchar_t* imagePath, int x, int y);
void drawButton(int x, int y, int width, int height, const wchar_t* text);
bool isButtonClicked(int x,int y,int width,int height,int mouseX,int mouseY);
void gamescreen();
void choose();
void GenerateFood(vector<point>& food, snake& snake, int count = 10);
int blockSize = 20;
int width = 48;
int height = 32;
int main()
{
	initgraph(960,640);
	HWND hwnd = GetHWnd();
	SetForegroundWindow(hwnd);
	showImage(_T("image\\start.jpg"),0 ,0);
	drawButton(400,500,150,80, _T("Start"));
	settextcolor(RED);
	settextstyle(40,0, _T("Consolas"));
	outtextxy(12,60, _T("If your scores is not enough,nailong will eat you!"));
	while (true) {
		if (MouseHit()) {
			MOUSEMSG msg = GetMouseMsg();
			if (msg.uMsg == WM_LBUTTONDOWN) {
				if (isButtonClicked(400, 500, 150, 80, msg.x, msg.y)) {
					closegraph();
					choose();
					break;
				}
			}
		}
	}
	closegraph();
	return 0;
}
